<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>14CSS背景</title>
    <style>
        div {
            background-image: url('../images/banner-1.png');
            width: 1000px;
            height: 500px;
            /* 值是方位名词时和顺序无关；如果只写一个方位词，则第二个默认居中对齐 */
            /* 如果插入图片是超大图1920px宽，为了显示中间核心部分，用center top */
            background-position: center top;
            /* 如果精确单位只有一个数值，一定是x轴的值，y轴则为垂直居中 */
            /* background-position: 10px; */
            background-repeat: no-repeat;
            /* 背景图片会压住背景颜色 */
            background-color: coral;
            /* 固定背景图像 */
            background-attachment: fixed;
            /* 复合写法 一般顺序为：背景颜色、背景图片地址、背景平铺、背景图像滚动、背景图片位置*/
            background: rgba(0, 0, 0, .3) url('../images/shouye.png') no-repeat fixed left center;
        }
        
        h3 {
            background-image: url('../images/shouye.png');
            background-position: left center;
            background-repeat: no-repeat;
            font-weight: normal;
            font-size: 16px;
            padding-left: 60px;
            width: 150px;
            height: 40px;
            line-height: 40px;
        }
    </style>
</head>

<body>
    <div></div>
    <h3>这里是背景图片演示</h3>
</body>

</html>